export function toSearchParams(location) {
    const {search} = location;
    const paramsString = search.substring(1);
    return new URLSearchParams(paramsString);
}


export function searchParamsToSearch(param) {
    let str = "";
    param.forEach((value, key) => {
        const t = str === "" ? "?" : "&";
        str = str + t + key + "=" + value;
    });
    return str;
}
